package com.whfc.gas.entity;

/**
 * @Description: 气体枚举
 * @author: xugcheng
 * @version: 1.0
 * @date: 2021-08-26 15:14
 */
public enum GasEnum {

    O2("氧气", 0x0001),

    H2S("硫化氢", 0x0002),

    CH4("甲烷", 0x0004),

    Ex("可燃气", 0x002E),

    CO("一氧化碳", 0x0010),

    EnvTemp("温度", 0x0FFF),

    EnvRh("湿度", 0x0FFE);

    private String name;

    private int value;

    GasEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static GasEnum parseByValue(int value) {
        GasEnum[] gasEnums = GasEnum.values();
        for (GasEnum gasEnum : gasEnums) {
            if (gasEnum.getValue() == value) {
                return gasEnum;
            }
        }
        return null;
    }

}
